package com.lishe.lishe.lishe.http;

import android.util.Log;

import com.lishe.lishe.asynchttp.HttpUtils;
import com.lishe.lishe.lishe.common.Globals;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.ResponseHandlerInterface;

/**
 * Created by shino on 2017/11/1.
 * 公用接口user
 */

public class HttpUser {
    private static final String TABLE_GOODS = "user/";


    /**
     * 获取用户积分
     * http://api.lishe.cn/index.php/user/assets
     */
    public static void getIntegral(ResponseHandlerInterface response) {
        RequestParams params = new RequestParams();
        params.put("token", Globals.getToken());
        HttpUtils.post(Globals.LISHE_URL + TABLE_GOODS + "assets", params, response);
    }

    /**
     * 获取用户积分
     * http://api.lishe.cn/index.php/other/setCurrentToken
     */
    public static void getUpToken(String token,String comId, ResponseHandlerInterface response) {
        RequestParams params = new RequestParams();
        params.put("token", token);
        params.put("comId", comId);
        if(comId!=null){
            Log.e("更新getUpToken()","comId"+comId);
        }
        if(comId!=null){
            Log.e("更新getUpToken()","token"+token);
        }
        HttpUtils.post(Globals.LISHE_URL + "other/setCurrentToken", params, response);
    }

}
